package o;

import android.text.TextUtils;
import java.util.Locale;
import org.json.JSONObject;

public class dlu {
    public static String ॱ() {
        Object ˏ = ˏ();
        if (TextUtils.isEmpty(ˏ)) {
            return "";
        }
        try {
            String replaceAll = ˏ.toLowerCase(Locale.ENGLISH).replaceAll("_", "-");
            JSONObject jSONObject = new JSONObject("{\"en-\":\"en-us\",\"es-\":\"es-es\",\"ko-\":\"ko-kr\",\"my-\":\"my-zg\",\"pt-\":\"pt-pt\",\"zh-hans-\":\"zh-cn\",\"zh-hant-\":\"zh-tw\",\"zh-hans-sg\":\"zh-cn\",\"zh-hans-mo\":\"zh-cn\",\"zh-hans-hk\":\"zh-cn\",\"zh-hans-cn\":\"zh-cn\",\"zh-hant-mo\":\"zh-hk\",\"zh-hant-hk\":\"zh-hk\",\"zh-hant-tw\":\"zh-tw\",\"am-\":\"am-et\",\"ar-\":\"ar-eg\",\"as-\":\"as-in\",\"az-\":\"az-az\",\"be-\":\"be-by\",\"bg-\":\"bg-bg\",\"bn-\":\"bn-bd\",\"bo-\":\"bo-cn\",\"bs-\":\"bs-ba\",\"ca-\":\"ca-es\",\"cs-\":\"cs-cz\",\"da-\":\"da-dk\",\"de-\":\"de-de\",\"el-\":\"el-gr\",\"en-ws\":\"en-gb\",\"en-vg\":\"en-gb\",\"en-vc\":\"en-gb\",\"en-tv\":\"en-gb\",\"en-tt\":\"en-gb\",\"en-tk\":\"en-gb\",\"en-tc\":\"en-gb\",\"en-sz\":\"en-gb\",\"en-sx\":\"en-gb\",\"en-ss\":\"en-gb\",\"en-sl\":\"en-gb\",\"en-sh\":\"en-gb\",\"en-sg\":\"en-gb\",\"en-sd\":\"en-gb\",\"en-sc\":\"en-gb\",\"en-sb\":\"en-gb\",\"en-pw\":\"en-gb\",\"en-pn\":\"en-gb\",\"en-pk\":\"en-gb\",\"en-pg\":\"en-gb\",\"en-nz\":\"en-gb\",\"en-nu\":\"en-gb\",\"en-nr\":\"en-gb\",\"en-nf\":\"en-gb\",\"en-my\":\"en-gb\",\"en-mt\":\"en-gb\",\"en-ms\":\"en-gb\",\"en-mo\":\"en-gb\",\"en-ls\":\"en-gb\",\"en-lr\":\"en-gb\",\"en-lc\":\"en-gb\",\"en-ky\":\"en-gb\",\"en-kn\":\"en-gb\",\"en-ki\":\"en-gb\",\"en-je\":\"en-gb\",\"en-io\":\"en-gb\",\"en-in\":\"en-gb\",\"en-im\":\"en-gb\",\"en-ie\":\"en-gb\",\"en-hk\":\"en-gb\",\"en-gy\":\"en-gb\",\"en-gi\":\"en-gb\",\"en-gg\":\"en-gb\",\"en-gd\":\"en-gb\",\"en-gb\":\"en-gb\",\"en-fm\":\"en-gb\",\"en-fk\":\"en-gb\",\"en-er\":\"en-gb\",\"en-dg\":\"en-gb\",\"en-cx\":\"en-gb\",\"en-ck\":\"en-gb\",\"en-cc\":\"en-gb\",\"en-bz\":\"en-gb\",\"en-bs\":\"en-gb\",\"en-bm\":\"en-gb\",\"en-be\":\"en-gb\",\"en-bb\":\"en-gb\",\"en-au\":\"en-gb\",\"en-ai\":\"en-gb\",\"en-ag\":\"en-gb\",\"en-zw\":\"en-us\",\"en-zm\":\"en-us\",\"en-za\":\"en-us\",\"en-xa\":\"en-us\",\"en-vu\":\"en-us\",\"en-vi\":\"en-us\",\"en-us\":\"en-us\",\"en-um\":\"en-us\",\"en-ug\":\"en-us\",\"en-tz\":\"en-us\",\"en-to\":\"en-us\",\"en-si\":\"en-us\",\"en-se\":\"en-us\",\"en-rw\":\"en-us\",\"en-pr\":\"en-us\",\"en-ph\":\"en-us\",\"en-nl\":\"en-us\",\"en-ng\":\"en-us\",\"en-na\":\"en-us\",\"en-mw\":\"en-us\",\"en-mu\":\"en-us\",\"en-mp\":\"en-us\",\"en-mh\":\"en-us\",\"en-mg\":\"en-us\",\"en-ke\":\"en-us\",\"en-jm\":\"en-us\",\"en-il\":\"en-us\",\"en-gu\":\"en-us\",\"en-gm\":\"en-us\",\"en-gh\":\"en-us\",\"en-fj\":\"en-us\",\"en-fi\":\"en-us\",\"en-dm\":\"en-us\",\"en-dk\":\"en-us\",\"en-de\":\"en-us\",\"en-cy\":\"en-us\",\"en-cm\":\"en-us\",\"en-ch\":\"en-us\",\"en-ca\":\"en-us\",\"en-bw\":\"en-us\",\"en-bi\":\"en-us\",\"en-at\":\"en-us\",\"en-as\":\"en-us\",\"es-ph\":\"es-es\",\"es-ic\":\"es-es\",\"es-gq\":\"es-es\",\"es-es\":\"es-es\",\"es-ea\":\"es-es\",\"es-ve\":\"es-us\",\"es-uy\":\"es-us\",\"es-us\":\"es-us\",\"es-sv\":\"es-us\",\"es-py\":\"es-us\",\"es-pr\":\"es-us\",\"es-pe\":\"es-us\",\"es-pa\":\"es-us\",\"es-ni\":\"es-us\",\"es-mx\":\"es-us\",\"es-hn\":\"es-us\",\"es-gt\":\"es-us\",\"es-ec\":\"es-us\",\"es-do\":\"es-us\",\"es-cu\":\"es-us\",\"es-cr\":\"es-us\",\"es-co\":\"es-us\",\"es-cl\":\"es-us\",\"es-bo\":\"es-us\",\"es-ar\":\"es-us\",\"et-\":\"et-ee\",\"eu-\":\"eu-es\",\"fa-\":\"fa-ir\",\"fi-\":\"fi-fi\",\"fr-\":\"fr-fr\",\"gl-\":\"gl-es\",\"gu-\":\"gu-in\",\"hi-\":\"hi-in\",\"hr-\":\"hr-hr\",\"hu-\":\"hu-hu\",\"hy-\":\"hy-am\",\"in-\":\"in-id\",\"is-\":\"is-is\",\"it-\":\"it-it\",\"iw-\":\"iw-il\",\"ja-\":\"ja-jp\",\"jv-\":\"jv-id\",\"ka-\":\"ka-ge\",\"kk-\":\"kk-kz\",\"km-\":\"km-kh\",\"kn-\":\"kn-in\",\"ko-kp\":\"ko-kp\",\"ko-kr\":\"ko-kr\",\"ky-\":\"ky-kg\",\"lo-\":\"lo-la\",\"lt-\":\"lt-lt\",\"lv-\":\"lv-lv\",\"mai-\":\"mai-in\",\"mi-\":\"mi-nz\",\"mk-\":\"mk-mk\",\"ml-\":\"ml-in\",\"mn-\":\"mn-mn\",\"mr-\":\"mr-in\",\"ms-\":\"ms-my\",\"my-mm\":\"my-mm\",\"my-zg\":\"my-zg\",\"nb-\":\"nb-no\",\"ne-\":\"ne-np\",\"nl-\":\"nl-nl\",\"or-\":\"or-in\",\"pa-\":\"pa-in\",\"pl-pl\":\"pl-pl\",\"pt-br\":\"pt-br\",\"pt-tl\":\"pt-pt\",\"pt-st\":\"pt-pt\",\"pt-pt\":\"pt-pt\",\"pt-mz\":\"pt-pt\",\"pt-mo\":\"pt-pt\",\"pt-gw\":\"pt-pt\",\"pt-cv\":\"pt-pt\",\"pt-ao\":\"pt-pt\",\"ro-\":\"ro-ro\",\"ru-\":\"ru-ru\",\"si-\":\"si-lk\",\"sk-\":\"sk-sk\",\"sl-\":\"sl-si\",\"sq-\":\"sq-al\",\"sr-\":\"sr-rs\",\"sr-latn-\":\"sr-rs\",\"sv-\":\"sv-se\",\"sw-\":\"sw-tz\",\"ta-\":\"ta-in\",\"te-\":\"te-in\",\"th-\":\"th-th\",\"tl-\":\"tl-ph\",\"tr-\":\"tr-tr\",\"ug-\":\"ug-cn\",\"uk-\":\"uk-ua\",\"ur-\":\"ur-pk\",\"uz-\":\"uz-uz\",\"vi-\":\"vi-vn\",\"fil-\":\"tl-ph\",\"he-\":\"iw-il\",\"id-\":\"in-id\",\"zh-\":\"zh-cn\",\"zh-tw\":\"zh-tw\",\"zh-hk\":\"zh-hk\",\"my-qaag-\":\"my-zg\",\"en-qaag-\":\"en-gb\",\"fi-ph\":\"tl-ph\"}");
            if (jSONObject.has(replaceAll)) {
                return jSONObject.getString(replaceAll);
            }
            if (replaceAll.contains("-")) {
                replaceAll = replaceAll.substring(0, replaceAll.lastIndexOf("-") + 1);
            }
            Logger.ˏ("PrivacyLanguageHelper", "check sub:" + replaceAll);
            if (jSONObject.has(replaceAll)) {
                return jSONObject.getString(replaceAll);
            }
            return "";
        } catch (Exception e) {
            Logger.e("PrivacyLanguageHelper", "getLanguage throw");
            return "";
        }
    }

    private static String ˏ() {
        String language = Locale.getDefault().getLanguage();
        Object script = Locale.getDefault().getScript();
        String country = Locale.getDefault().getCountry();
        if (TextUtils.isEmpty(language)) {
            language = "en";
        }
        if (TextUtils.isEmpty(country)) {
            country = "US";
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(language);
        stringBuilder.append("_");
        if (!TextUtils.isEmpty(script)) {
            stringBuilder.append(script);
            stringBuilder.append("_");
        }
        stringBuilder.append(country);
        return stringBuilder.toString();
    }
}
